home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / GDM003.ZIP / SPRITED / SPRITED.DOC < prev    next >
Encoding:
Text File  |  1993-03-16  |  20.4 KB  |  566 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.                                      │  │ ┌──┐   
  32.                                      └──┤ │    's
  33.                                       ──┘ └──┘   
  34.  
  35.                                   Sprite Editor 1.0
  36.                            Copyright 1993 by Curtis Keisler
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.                                   TABLE OF CONTENTS
  45.  
  46.           1. INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . .   1
  47.  
  48.           2. ACKNOWLEDGMENTS  . . . . . . . . . . . . . . . . . . . . .   1
  49.  
  50.           3. DISCLAIMER . . . . . . . . . . . . . . . . . . . . . . . .   1
  51.  
  52.           4. GETTING STARTED  . . . . . . . . . . . . . . . . . . . . .   1
  53.  
  54.           5. SCREEN LAYOUT  . . . . . . . . . . . . . . . . . . . . . .   2
  55.  
  56.           6. HOW TO USE THE PROGRAM . . . . . . . . . . . . . . . . . .   2
  57.  
  58.           7. THE PALETTE  . . . . . . . . . . . . . . . . . . . . . . .   3
  59.  
  60.           8. THE DRAWING PRIMITIVES . . . . . . . . . . . . . . . . . .   3
  61.                8.1 Draw . . . . . . . . . . . . . . . . . . . . . . . .   3
  62.                8.2 Line . . . . . . . . . . . . . . . . . . . . . . . .   3
  63.                8.3 Circle . . . . . . . . . . . . . . . . . . . . . . .   4
  64.                8.4 Rectangle  . . . . . . . . . . . . . . . . . . . . .   4
  65.                8.5 Solid Circles and Rectangles . . . . . . . . . . . .   4
  66.                8.6 Paint  . . . . . . . . . . . . . . . . . . . . . . .   4
  67.  
  68.           9. SPRITE POSITIONING FEATURES  . . . . . . . . . . . . . . .   4
  69.                9.1. Up, Down, Left, Right . . . . . . . . . . . . . . .   4
  70.                9.2. Rotate  . . . . . . . . . . . . . . . . . . . . . .   5
  71.                9.3. X-flip, Y-flip  . . . . . . . . . . . . . . . . . .   5
  72.                9.4. Grid  . . . . . . . . . . . . . . . . . . . . . . .   5
  73.                9.5. Tile  . . . . . . . . . . . . . . . . . . . . . . .   5
  74.                9.6. Undo  . . . . . . . . . . . . . . . . . . . . . . .   5
  75.  
  76.           10. SAVING, LOADING AND SOURCING  . . . . . . . . . . . . . .   6
  77.                10.1 Pascal, C . . . . . . . . . . . . . . . . . . . . .   6
  78.                10.2 Clear . . . . . . . . . . . . . . . . . . . . . . .   6
  79.                10.3 Save, Load  . . . . . . . . . . . . . . . . . . . .   7
  80.  
  81.           11. QUIT  . . . . . . . . . . . . . . . . . . . . . . . . . .   7
  82.  
  83.           12. GENERAL INFORMATION . . . . . . . . . . . . . . . . . . .   7
  84.  
  85.           13. REGISTRATION  . . . . . . . . . . . . . . . . . . . . . .   8
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.                                                                           i
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.           1. INTRODUCTION
  106.  
  107.           yc's Sprite Editor is a tool that aids the gaming programmer in
  108.           designing sprites used video games for the IBM PC compatible.  It
  109.           lets you create 32x32x256 color sprites for use in C and Pascal
  110.           programs (assembler too!).
  111.  
  112.           The requirements are a SVGA graphics adapter capable of
  113.           640x480x256 color in either Vesa, Trident or Video7 mode, a
  114.           Microsoft compatible mouse, at least 512k memory and a little
  115.           disk space for storing sprite files and/or source code.
  116.  
  117.           I wrote this program to help me in creating sprites for several
  118.           games that I am writing. I thought that it would be nice to
  119.           provide this tool to other game designers faced with the same
  120.           task.
  121.  
  122.           This program has a surprisingly high level of functionality.  It
  123.           provides simple drawing primitives such as bit level
  124.           manipulation, line drawing, circles, rectangles, filled circles,
  125.           filled rectangles, flood filling, x and/or y axis mirroring, 90
  126.           degree rotations, and a tiled view.  It also has an undo feature,
  127.           saving, loading, and C and Pascal "const" source output.
  128.  
  129.           2. ACKNOWLEDGMENTS
  130.  
  131.           Thanks to Borland International for providing such great
  132.           programming environments.  This program was written using Borland
  133.           Pascal 7.0.  I also use their C++ compiler and I highly recommend
  134.           ANYTHING that Borland produces.
  135.  
  136.           Thanks to Steve Holley for requesting of me to write this program
  137.           in the first place.
  138.  
  139.           Thanks to Michael Day of Knight Software, P.O. Box 22902,
  140.           Milwaukie, OR 97222, CIS [70007,4645] or [73577,2225] for
  141.           developing the 640x480x256 BGI's that I used to write this
  142.           program.  BGI256 V3.00 as of 22 Dec 1992 is Copyright (c)
  143.           1991,1992 by Knight Software.
  144.  
  145.           3. DISCLAIMER
  146.  
  147.           If this program kills your computer its not my fault.  By running
  148.           this program on your computer you are willingly releasing me, the
  149.           author, from any responsibility for loss.
  150.  
  151.           4. GETTING STARTED
  152.  
  153.           If you have a Vesa compatible SVGA card all you need to do is
  154.           type "sprited".  For Trident or Video7 compatibility, type
  155.           "sprited TRIDENT" or "sprited VIDEO7" respectively.
  156.  
  157.  
  158.                                                                           1
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.           5. SCREEN LAYOUT 
  167.  
  168.                 ┌───────────────────────┬────────────────────────────┐
  169.                 │                       │   ╔═══════════════╗ ╔═════╗│
  170.                 │                       │   ╚═══════════════╝ ╠═════╣│
  171.                 │                       │                     ╠═════╣│
  172.                 │                       │         ┌───┐       ╠═════╣│
  173.                 │                       │         │ 3 │       ╠═════╣│
  174.                 │          1            │         └───┘       ╠═════╣│
  175.                 │                       │                     ╠═════╣│
  176.                 │                       │                     ╠═════╣│
  177.                 │                       │      4┌────────┐    ╚═════╝│
  178.                 │                       │       └────────┘     5     │
  179.                 │                       │     ╔═════╗ ╔═════╗ ╔═════╗│
  180.                 ├───────────────────────┤     ╠═════╣ ╠═════╣ ╠═════╣│
  181.                 │                       │     ╠═════╣ ╠═════╣ ╠═════╣│
  182.                 │                       │     ╠═════╣ ╠═════╣ ╠═════╣│
  183.                 │                       │     ╠═════╣ ╠═════╣ ╠═════╣│
  184.                 │          2            │     ╚═════╝ ╠═════╣ ╠═════╣│
  185.                 │┌──────────┐┌─────────┐│             ╠═════╣ ╠═════╣│
  186.                 │└──────────┘└─────────┘│             ╚═════╝ ╚═════╝│
  187.                 └───────────────────────┴────────────────────────────┘
  188.  
  189.           (1)  This area contains a zoomed version of the sprite.  This
  190.                area is where ALL of the editing takes place.
  191.  
  192.           (2)  This area contains the color palette.  This is the resident
  193.                palette so no special provisions are necessary for re-
  194.                displaying the sprite in your programs, i.e. you don't need
  195.                to load and save palettes!
  196.  
  197.           (3)  This area shows the actual size of the sprite and reflects
  198.                exactly what is represented in area 1.
  199.  
  200.           (4)  This area displays in text the current editing mode.  This
  201.                describes the action that will be taken if the mouse is
  202.                clicked inside of area 1, the sprite editing area.
  203.  
  204.           (5)  This area contains the buttons that represent various
  205.                actions that can be performed on the sprite.
  206.  
  207.  
  208.           6. HOW TO USE THE PROGRAM
  209.  
  210.           Options are made by positioning the mouse cursor on one of the
  211.           graphic buttons on the screen, pressing the left button on the
  212.           mouse and then releasing the left mouse button while the graphic
  213.           button on the screen is depressed.
  214.  
  215.           The only time keyboard interaction is required is when a filename
  216.           is needed to write source code to disk and to save or retrieve a
  217.           sprite.
  218.  
  219.                                                                           2
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.           7. THE PALETTE
  228.  
  229.           The palette area contains three different components.  At the top
  230.           of the palette area you will see three collections of color
  231.           blocks.
  232.  
  233.           The first row of colors is the standard 16 colors (0-15). The
  234.           second row of colors is the 16 shades of gray (16-31).  The rest
  235.           of the area is the full spectrum with varying hues, saturation
  236.           and intensities (32-248).
  237.  
  238.           Beneath the color blocks to the left is a rectangle containing
  239.           the foreground color.  The rectangle to the right of the
  240.           foreground color is the background color.
  241.  
  242.           To change the foreground color, position the mouse pointer on the
  243.           color you desire and press the left mouse button.  The same can
  244.           be done for the background color using the right mouse button.
  245.  
  246.           8. THE DRAWING PRIMITIVES
  247.  
  248.           The drawing primitive buttons are located near the top right side
  249.           of the screen.  If you initiate a primitive using the left mouse
  250.           button, it will be drawn in the current foreground color.  If you
  251.           initiate a primitive using the right mouse button, it will be
  252.           drawn in the current background color. The following is a
  253.           description of the drawing primitives and the functions that they
  254.           perform. 
  255.  
  256.           8.1 Draw
  257.  
  258.           This button places you in draw mode.  It allows you to manipulate
  259.           the sprite one pixel at a time.  To draw on the sprite, place the
  260.           mouse cursor in area 1, the zoomed sprite area, and hold down a
  261.           mouse button.  As you move the mouse cursor within the editing
  262.           area, pixels will be placed on the sprite in the relevant color
  263.           (left button is the foreground color, right button is the
  264.           background color).
  265.  
  266.  
  267.           8.2 Line
  268.  
  269.           This button places you in line draw mode.  It allows you to draw
  270.           lines within the sprite. To draw a line on the sprite, place the
  271.           mouse cursor in area 1 where you want to start the line. Then,
  272.           while pressing a mouse button move the cursor to where you want
  273.           the line to be drawn and release the button.  As you move the
  274.           mouse while holding down a mouse button, the line will be redrawn
  275.           to show you what a line to the current position would look like. 
  276.           This is known as "rubber banding" and is used where appropriate.
  277.  
  278.  
  279.  
  280.                                                                           3
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.           8.3 Circle
  289.  
  290.           This button places you in circle mode.  It allows you to draw
  291.           circles within the sprite.  To draw a circle on the sprite, place
  292.           the mouse cursor in area 1 where you want the circle to be
  293.           centered.  While pressing a mouse button, move the mouse cursor
  294.           away from the center point to expand the radius of the circle or
  295.           toward the center to contract the radius.  When you have the
  296.           desired radius release the mouse button.
  297.  
  298.           8.4 Rectangle
  299.  
  300.           This button places you in rectangle mode. It allows you to draw
  301.           rectangles within the sprite.  To draw a rectangle on the sprite,
  302.           place the mouse cursor in area 1 where you want one of the
  303.           corners of the rectangle to be drawn.  While pressing a mouse
  304.           button, move the cursor to where you want to place the opposite
  305.           corner of the rectangle.  When you have the rectangle in the
  306.           desired location release the mouse button.
  307.  
  308.           8.5 Solid Circles and Rectangles
  309.  
  310.           These buttons function just like the "hollow" version buttons
  311.           except the inside of the primitive is solid.
  312.  
  313.           8.6 Paint
  314.  
  315.           This button places you in paint mode. It allows you to "seed
  316.           fill" an area of the sprite.  To paint an area, position the
  317.           mouse cursor INSIDE of the area to be filled and click the
  318.           appropriate mouse button.
  319.  
  320.           Every pixel that is the same color as the color of the pixel on
  321.           which you clicked will be painted in the appropriate color up to
  322.           the point where the area clicked on meets another color. i.e.
  323.           this works like PC Paintbrush's paint.
  324.  
  325.           9. SPRITE POSITIONING FEATURES
  326.  
  327.           Near the middle, bottom-half of the screen you will see a few
  328.           buttons devoted to manipulating the position of the ENTIRE
  329.           sprite.  The following is a description of each of these buttons
  330.           and what they do:
  331.  
  332.           9.1. Up, Down, Left, Right
  333.  
  334.           These buttons rotate with wrap around the entire sprite in the
  335.           direction indicated on the button.  This is good for centering a
  336.           sprite or for making several positional changes required in
  337.           animation.
  338.  
  339.  
  340.  
  341.                                                                           4
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.           9.2. Rotate
  350.  
  351.           This button rotates the sprite 90 degrees clockwise.
  352.  
  353.           9.3. X-flip, Y-flip
  354.  
  355.           This button mirrors the sprite in the respective cartesian axis
  356.           with the origin being in the center of the sprite.
  357.  
  358.           9.4. Grid
  359.  
  360.           This button toggles a grid on and off.  The sprite grid can be
  361.           useful for placing pixels when a reference is needed for
  362.           counting.
  363.  
  364.           9.5. Tile
  365.  
  366.           This button toggles the tile mode on and off.  Some sprites will
  367.           be used to tile a background. The tile feature places the sprite
  368.           in a 3 by 3 matrix so that you can get an idea of how the sprite
  369.           will look when tiled with itself.
  370.  
  371.           9.6. Undo
  372.  
  373.           Hey, we all make mistakes. This key will undo the last
  374.           destructive action performed on the sprite.  That means you can't
  375.           undo a rotate (you wouldn't need to undo a rotate anyway).  But,
  376.           lets say you painted a sprite and it goofed up the sprite.  Just
  377.           press undo, immediately afterwards, and the sprite will be
  378.           restored. 
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.                                                                           5
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.           10. SAVING, LOADING AND SOURCING
  411.  
  412.           The following is a description of what the rest of the buttons
  413.           do:
  414.  
  415.           10.1 Pascal, C
  416.  
  417.           These buttons will write out a "const" declaration, in the
  418.           respective programming language, that contains data that can be
  419.           directly used with a Borland Language's PutImage.  The following
  420.           is the format of the source output for the languages
  421.           respectively:
  422.  
  423.                Pascal Source
  424.  
  425.                     Const { test.pas }
  426.                       Image: Array[1..1028] Of Byte = (
  427.                         31,0,31,0,
  428.                         0,0,0, ...
  429.                         ...,0,0,0
  430.                       );
  431.  
  432.                C Source
  433.  
  434.                     /* test.c */
  435.                     const unsigned char image[1028]={31,0,31,0,
  436.                         0,0,0,...
  437.                         ...,0,0,0
  438.                     };
  439.  
  440.           Sprites written out as source CANNOT be loaded from the source. 
  441.           You must use the load and save buttons described below.
  442.  
  443.           When you press the "Pascal" or "C" buttons, a simple dialog box
  444.           appears in the middle of the screen prompting you for a file
  445.           name.  You can edit the filename using common editing keys like
  446.           [Backspace], the left and right arrows, [Delete], [Home], [End]
  447.           and [Ctrl][Backspace] to clear the line out.
  448.  
  449.           Just enter the filename you wish to name the source as and press
  450.           enter. You can also click on the "Ok" button to write the source
  451.           or the "Cancel" button to abort.
  452.  
  453.           If a disk error occurs, a dialog box will appear stating the
  454.           problem and wait for you to press return or click on the "Ok"
  455.           button.
  456.  
  457.           10.2 Clear
  458.  
  459.           This button clears the sprite to the current background color. 
  460.           If you press this button by accident don't panic, just press the
  461.           "Undo" button.
  462.  
  463.                                                                           6
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.           10.3 Save, Load
  472.  
  473.           These buttons allow you to save and load, to and from disk the
  474.           sprites that you have created.  
  475.  
  476.           When you press the "Save" or "Load" buttons, a simple dialog box
  477.           appears in the middle of the screen prompting you for a file
  478.           name.  You can edit the filename using common editing keys like
  479.           [Backspace], the left and right arrows, [Delete], [Home], [End]
  480.           and [Ctrl][Backspace] to clear the line out.
  481.  
  482.           If you are saving the sprite, just enter the filename you wish to
  483.           name the sprite.  If you are loading a sprite, just enter the
  484.           filename of the sprite to be loaded. Then press [Enter]. You can
  485.           also click on the "Ok" button to continue or the "Cancel" button
  486.           to abort.
  487.  
  488.           If a disk error occurs, a dialog box will appear stating the
  489.           problem and wait for you to press return or click on the "Ok"
  490.           button.
  491.  
  492.           The format in which the sprites are saved is very simple. It is
  493.           just the raw data that is represented in the source output.  So,
  494.           if you wanted to store sprites on disk for using with Borland's
  495.           BGI PutImage function instead of storing the sprite in the
  496.           executable, all you need to do is allocate the memory, open the
  497.           file, read in the sprite and use the variable in the PutImage
  498.           function. Its just that simple!
  499.  
  500.           11. QUIT
  501.  
  502.           This button exits the program.  Be sure that you have saved your
  503.           work before exiting.
  504.  
  505.           12. GENERAL INFORMATION
  506.  
  507.           I threw this program together in one weekend, including the GUI,
  508.           and the SVGA mouse driver, so I would not be surprised if you
  509.           found a bug or two in it.  If you find that the program does not
  510.           function properly, please let me know.  I am a regular user of
  511.           CompuServe and you can send e-mail to me there at 76424,1521.
  512.  
  513.           Also, if you have any comments or suggestions, especially
  514.           negative ones, please feel free to relay them to me on either
  515.           CompuServe or at the address supplied below.
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.                                                                           7
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.           13. REGISTRATION
  533.  
  534.           If you find yourself using this program often then you need to
  535.           register it.  You can register this program by sending $10.00 to:
  536.  
  537.                               Curtis Keisler
  538.                               c/o Sprite Editor
  539.                               Rt. 2 Box 251-K
  540.                               Williston, SC 29853
  541.  
  542.  
  543.           Also, I would like it if you would drop me a suggestion or two
  544.           along with this filled out form, especially if you are NOT in the
  545.           USA and even if you don't register!
  546.  
  547.           (Please print)
  548.  
  549.  
  550.           Name ____________________________________________________________
  551.  
  552.           Address _________________________________________________________
  553.  
  554.           City ____________________________________________________________
  555.  
  556.           State ___________________________________________________________
  557.  
  558.           Zip _____________________________________________________________
  559.  
  560.           Country _________________________________________________________
  561.  
  562.           Where you obtained this program _________________________________
  563.  
  564.           _________________________________________________________________
  565.  
  566.           Comments  _______________________________________________________
  567.  
  568.           _________________________________________________________________
  569.  
  570.           _________________________________________________________________
  571.  
  572.           _________________________________________________________________
  573.  
  574.  
  575.  
  576.           Product                  Qty                      Total
  577.           ______________________   ____                     __________
  578.  
  579.           yc's Sprite Editor 1.0   ____  @ $10.00 per copy = __________
  580.  
  581.  
  582.           Have a nice day!
  583.  
  584.  
  585.                                                                           8
  586.